Previous Book Contents Book Index Next

Inside Macintosh: Mac OS 8 Toolbox Reference /
Chapter 2 - Control Manager Reference / Control Manager Functions
Defining Your Own User Pane Functions /


MyUserPaneBackgroundProc

NEW WITH THE APPEARANCE MANAGER

Sets the background color or pattern (only for user panes that support embedding).

The Control Manager declares the type for an application-defined user pane focus function as follows:

typedef pascal (*ControlUserPaneBackgroundProcPtr)(
                              ControlHandle control,
                              ControlBackgroundPtr info);
The Control Manager defines the data type ControlUserPaneBackgroundUPP to identify the universal procedure pointer for this application-defined function:

typedef UniversalProcPtr ControlUserPaneBackgroundUPP;
You typically use the NewControlUserPaneBackgroundProc macro like this:

ControlUserPaneBackgroundUPP myControlUserPaneBackgroundUPP;
myControlUserPaneBackgroundUPP = NewControlUserPaneBackgroundProc 
(MyUsePaneBackground);
You typically use the CallControlUserPaneBackgroundProc macro like this:

CallControlUserPaneBackgroundProc(myControlUserPaneBackgroundUPP, 
control, info);
Here's how to declare the function MyUserPaneBackgroundProc:

pascal void MyUserPaneBackgroundProc (
                     ControlHandle control
                     ControlBackgroundPtr info);
control
A handle to the control for which the background color or pattern is to be set.
info
A pointer to information such as the depth and type of the drawing device.
DISCUSSION
Your MyUserPaneFocusProc function should set the user pane background color or pattern to whatever is appropriate given the bit depth and device type passed in.

This function will only get called if you've set the kControlHasSpecialBackground and kControlSupportsEmbedding feature bits on creation of the user pane control. Once you have created the function MyUserPaneBackgroundProc, pass kControlUserPaneBackgroundProcTag in the tagName parameter of SetControlData.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
8 JAN 1998